<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<%
	xMode = Request("xMode")
	
	isPerm = ""
	isAdminPerm = "none"
	If Request.Cookies("S_level") = "05" then 
		isPerm = "none"
	End If
	If Request.Cookies("S_level") = "50" then 
		isAdminPerm = ""
	End If
	
	'## ■■ 제품그룹 가져오기 ■■■■
	prdGrpSQL = "SELECT itemNm, itemCd FROM tblComCode WHERE flag='Y' AND groupCd='0003' ORDER BY itemSeq" 

	Set prdGrpRs=Server.CreateObject("ADODB.RecordSet")
	prdGrpRs.open prdGrpSQL, DbCon, 1
	
	prdGrpSet = ""
	If prdGrpRs.eof Or prdGrpRs.bof Then 
	Else 
		Do Until prdGrpRs.eof Or prdGrpRs.bof
		
		prdGrpSet = prdGrpSet & "<option value=""" & prdGrpRs("itemCd") & """>" & prdGrpRs("itemNm") & "</option>" & vbcrlf

		prdGrpRs.movenext
		Loop 
	End If
	
%>
<!-- #include virtual=/inc/header_cross.inc.asp -->  

<script language="javascript">    
		 $(document).ready(function() {
			  var clareCalendar = {
			   monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
			   dayNamesMin: ['일','월','화','수','목','금','토'],
			   weekHeader: 'Wk',
			   dateFormat: 'yy-mm-dd',														// 날짜형식(2012-03-03)
			   autoSize: false,																	//자동리사이즈(false 이면 상위 정의에 따름)
			   changeMonth: true,															// true이면 월변경, false이면 월변경못함
			   changeYear: true,																// true이면 년변경, false이면 년변경못함
			   showMonthAfterYear: true,													//년 뒤에 월 표시
			   buttonImageOnly: true,														//이미지표시
			   //buttonText: '달력선택',														//버튼 텍스트 표시
			   //buttonImage: '/calendar.gif',												//이미지주소
			   //showOn: "both",																//엘리먼트와 이미지 동시 사용(both,button)
			   yearRange: 'c-99:c+99',													//1990년부터 2020년까지
			   maxDate: '+2Y',																	// 오늘부터6년후날짜까지만, '+0d' 오늘 이전 날짜만 선택
			   minDate: '-5y'
			  };
			  $("#findStartDt").datepicker(clareCalendar);
			  $("#findEndDt").datepicker(clareCalendar);
			  $("#incomeDt").datepicker(clareCalendar);
			  $("img.ui-datepicker-trigger").attr("style","margin-left:5px; vertical-align:middle; cursor:pointer;"); //이미지버튼 style적용
			  $("#ui-datepicker-div").hide(); //자동으로 생성되는 div객체 숨김  
		});
		
	   $(window).load(function(){
	       grid01List(1);
	       fnCommonInit();
	    });     
</script>

<BODY topmargin="0" leftmargin="0">
<!-- #include virtual=/inc/menu.inc.asp -->  

<br>
<!-- 검색 영역 시작 -->
<div style="text-align:left;margin-top:10px;">
<table border="0" cellpadding="0" cellspacing="0" width="1237" style="margin-left:5px;">
	<tr height="40">
		<td style="padding: 0px 0 0px 10px;background-image:url(/inc/layout/panel-title-light-bg.gif);font-weight:bold;text-align:left" width="100%" class="lTD_trbl">
			<select id="findPrdGrp"><option value="">--제품그룹--</option><%=prdGrpSet%></select> &nbsp; 
			제품명 <input type="text" name="findPrdNm" id="findPrdNm" class="inputBox" style="width:80px;ime-Mode:active"> &nbsp;
			거래처 제품코드 <input type="text" name="findEtcPrdCd" id="findEtcPrdCd" class="inputBox" style="width:80px;ime-Mode:active"> &nbsp; 
			재고 >= <input type="text" name="findGoods" id="findGoods" class="inputBox" value="0" style="width:60px;ime-Mode:active"> &nbsp;
			<select name="findMkType" id="findMkType">
				<option value="">전체</option>
				<option value="L">양산</option>
				<option value="D">개발</option>
			</select>
			<input type="button" onClick="grid01List()" value="검 색" class="inputBtn">&nbsp;
			<input type="button" onClick="fnSearchReset()" value="Reset" class="inputBtn">
		</td>
	</tr>
</table>
</div>
<!-- 검색 영역 끝 -->


<br>

<!-- 그리드 시작 -->
<div style="text-align:left">
<table border="0" cellpadding="0" cellspacing="0" width="1235" style="margin-left:5px;text-align:left">
	<tr>
		<td width="100%" class="lTD_trbl" valign="top" style="padding: 5px 5px 5px 5px;">
			<table border="0" cellpadding="0" cellspacing="0" width="710">
				<tr height="24">
					<td style="padding: 0 0 0 0;text-align:left" width="400"><input type="text" class="subTitle" style="width:80px;" value="제품관리" ReadOnly>&nbsp;<a href="javascript:grid01List()">[새로고침]</a> &nbsp; </td>
					<td style="padding: 0 20px 0 0;" align="right" width="310"><B>Total :</B> <span id="grid01Cnt" style="font-weight:bold">0</span></td>
				</tr>
			</table>
			<table border="0" cellpadding="0" cellspacing="0" width="710"><tr><td style="background-color:#3366CC;height:2px"></td></tr></table>			
			<div id="grid1">
				<div id="gridHeader1">
					<div style="width:40px"><p>No.</p></div>
					<div style="width:85px"><p>제품코드</p></div>
					<div style="width:225px"><p>제품명</p></div>
					<div style="width:120px"><p>발주처</p></div>
					<div style="width:125px"><p>재고（포장／검사）</p></div>
					<div style="width:49px"><p>그룹</p></div>
					<div style="width:40px"><p>생산</p></div>
					<div style="width:18px">&nbsp;</div>
				</div>
				<div id="noResult1">
					<div><p>결과가 없습니다.</p></div>
				</div>
				<div id="gridBody1" style="display:none;">								
				</div>
				<div id="gridTail1" style="">
					<div class="term"></div>
					<div id="pager1"></div>
				</div>
			</div>			
			<!--
			<div class="tblContainer" id="gridLayer01" style="width:590px; height:600px; overflow-y:scroll">
			<form name="frmGrid01">
			<table border="0" id="Grid01" width="573" cellpadding="0" cellspacing="0">
				<thead>
				<tr bgcolor="#EEECE7" height="25" align="center">
					<td width="40" class="lTD_0rbl gridTitle">No.</td>
					<td width="80" class="lTD_0rb0 gridTitle">제품코드</td>
					<td width="160" class="lTD_0rb0 gridTitle">제품명</td>
					<td width="110" class="lTD_0rb0 gridTitle">발주처</td>
					<td width="103" class="lTD_0rb0 gridTitle">재고(포장/검사)</td>
					<td width="50" class="lTD_0rb0 gridTitle">그룹</td>
					<td width="40" class="lTD_0rb0 gridTitle">생산</td>
				</tr>
				<tr id="tr01Result" bgcolor="#FFFFFF" height="25" align="center">
					<td colspan="7" style="color:#948D88; BORDER-TOP: #abccf8 0px solid;" class="lTD_0rbl"><span id="loadSpan1" style="color:#CE7302">검색된 자료가 없습니다.</span></td>
				</tr>
				</thead>
				<tbody></tbody>
			</table>
			</form>
			</div>
			<table border="0" width="590" cellpadding="0" cellspacing="0">
				<tr>
					<td align="left" colspan="6" bgcolor="FFFFFF" style="BORDER-BOTTOM: #abccf8 1px solid;BORDER-LEFT: #abccf8 1px solid;BORDER-TOP: #abccf8 1px solid;BORDER-RIGHT: #abccf8 1px solid;padding-top:0px">
						<table width="100%" border="0" cellpadding="0" cellspacing="0">
							<tr align="center" height="30">
								<td style="background-image:url(/inc/layout/panel-title-light-bg.gif)"><span id="pageDiv01"></span></td>
							</tr>									
						</table>
					</td>
				</tr>
			</table>
			-->
		</td>
		<td valign="top" style="text-align:center; padding-left:5px">					
			<table border="0" cellpadding="0" cellspacing="0" width="500">
				<tr>
				  <td width="100%" class="lTD_trbl" style="padding: 5px 5px 5px 5px; text-align:center">
					<table border="0" cellpadding="0" cellspacing="0" width="490">
						<input type="hidden" name="prdCd" id="prdCd">
						<tr>
							<td height="30" width="490" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold">
								제 &nbsp; &nbsp; &nbsp; 품 &nbsp; &nbsp; &nbsp; 명 &nbsp; : &nbsp; <input type="text" name="prdNm" id="prdNm" size="22" class="specialBox" onblur="fnFindProduct(this.value,'','showPrdNm')"> &nbsp;&nbsp; 
								<select name="showPrdNm" id="showPrdNm" style="width:150px"><option value="">--제품명--</option></select>
							</td>
						</tr>
						<tr style="display:<%=isPerm%>">
							<td height="30" width="490" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold;">
								발 &nbsp; &nbsp; &nbsp; 주 &nbsp; &nbsp; &nbsp; 처 &nbsp; : &nbsp;<input type="text" name="compNm" id="compNm" size="22" class="inputBox" style="margin-left:4px" onblur="fnFindCompany(this.value,'','compCd')"> &nbsp;&nbsp; 
								<select name="compCd" id="compCd" style="width:150px"><option value="">--거래처--</option></select>
							</td>
						</tr>
						<tr style="display:<%=isPerm%>">
							<td height="30" width="490" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold">
								발주처 제품 코드 &nbsp; : &nbsp;<input type="text" name="etcPrdCd" id="etcPrdCd" size="22" class="inputBox" style="margin-left:4px"> &nbsp;&nbsp;
								<select id="prdGrp"><option value="">--제품그룹--</option><%=prdGrpSet%></select>
							</td>
						</tr>
						<tr>
							<td height="30" width="490" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold">
								원 자 재 &nbsp; &nbsp; 규 격 &nbsp; : &nbsp;<input type="text" name="sourceSize" id="sourceSize" size="50" class="inputBox" style="margin-left:4px"> &nbsp; &nbsp; &nbsp;
							</td>
						</tr>
						<tr style="display:<%=isAdminPerm%>">
							<td height="30" width="490" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold">
								판 매 &nbsp; &nbsp; &nbsp; &nbsp; 단 가 &nbsp; : &nbsp;<input type="text" name="unitPrice" id="unitPrice" size="10" class="inputBox" style="margin-left:4px;text-align:right"> &nbsp; &nbsp; &nbsp;
							</td>
						</tr>
						<tr>
							<td width="490" class="lTD_00b0" style="padding: 10px 0 10px 20px; text-align:left; font-weight:bold">
								<textarea name="remarks" id="remarks" class="inputBox" style="width:450px; height:80px"></textarea>

							</td>
						</tr>
						<tr style="display:<%=isPerm%>">
							<td height="30" width="490" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold">
								<select name="flag" id="flag">
									<option value="Y">생산중</option>
									<option value="H">생산정지</option>
									<option value="N">삭제</option>
								</select> &nbsp; &nbsp;<input type="text" id="accessInfo" style="font-weight:normal;width:120px; border:0px">
								<span>
								<input type="button" value="작업상세보기" class="inputBtn" onClick="fnOrderDetail()"> &nbsp;
								<input type="button" value="저장" class="inputBtn" onClick="fnSave()"> 
								<input type="button" value="신규" class="inputBtn" onClick="fnReset()">
								</span>
							</td>
						</tr>
					</table>
				  </td>
				</tr>
			</table>
		</td>		
	</tr>
</table>
</div>
<!-- 그리그 끝 -->

<script language="javascript">
	setMainMenu();
//	//## 테스트를 위한 기본 값세팅	
//	$("#prdNm").val("연습00");
//	$("#etcPrdCd").val("TEST01-00");
//	$("#remarks").val("연습중\r\nThis is testing....");
</script>
</BODY>
</HTML>